package com.uidp.domain;

import com.acsior.dac.exeption.DataAccessException;
import com.acsior.sbc.exception.BusinessException;
import com.acsior.sbc.exception.ValidationException;
import com.acsior.sbc.impl.hibernate.HibernateBusinessObject;
import com.uidp.hibernatelayer.GroupsAttributeDAO;
import com.uidp.hibernatelayer.GroupsAttributeVO;

public class GroupsAttribute extends
		HibernateBusinessObject<GroupsAttributeVO, GroupsAttributeDAO> {

	private Attributes attributes;
	private Groups groups;
	private Integer ordering;

	public GroupsAttribute() throws BusinessException {
		super();
	}

	public GroupsAttribute(GroupsAttributeVO h) throws BusinessException {
		super(h);
	}

	/** @see PersistentObject#initialize() */
	@Override
	protected void initialize() throws BusinessException {
		super.initialize();
		setAttributes(new Attributes());
		setGroups(new Groups());
	}

	@Override
	protected void setValues(GroupsAttributeVO h) throws DataAccessException {
		h.setOrdering(getOrdering());
		h.setAttributes(getAttributes().findData());
		h.setGroups(getGroups().findData());

	}

	@Override
	protected void copyProperties(GroupsAttributeVO d, boolean deepCopy)
			throws BusinessException {
		setOrdering(d.getOrdering());
		setAttributes(new Attributes(d.getAttributes()));
		setGroups(new Groups(d.getGroups()));

	}

	@Override
	protected void validate() throws ValidationException {
		// TODO Auto-generated method stub

	}

	@Override
	protected Class<GroupsAttributeDAO> getDAOClass() {
		return GroupsAttributeDAO.class;
	}

	public Attributes getAttributes() {
		return attributes;
	}

	public void setAttributes(Attributes attributes) {
		this.attributes = attributes;
	}

	public Groups getGroups() {
		return groups;
	}

	public void setGroups(Groups groups) {
		this.groups = groups;
	}

	public Integer getOrdering() {
		return ordering;
	}

	public void setOrdering(Integer ordering) {
		this.ordering = ordering;
	}

}
